
function save(str){
var xmlHttp;
	try{
		xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
	}
	catch (e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
		}
		catch (e){
		    try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				alert("No AJAX!?");
				return false;
			}
		}
	}

xmlHttp.onreadystatechange=function(){
   // var answer=document.form_answer.answer.value;
    //document.write(answer);
	if(xmlHttp.readyState==4){
	document.getElementById("result").innerHTML="<center>"+"<h18>"+xmlHttp.responseText+"</h18>"+"</center>";        
	}
}

for(var i=0;i<3;i++){
    var final_name="";
   var namee=str+"@"+i;
   var name= document.getElementById(namee).value;
   if(name.indexOf("*")!=-1||name.length<3){
      continue;
   }else{
       final_name=name;
       break;
   }
}
xmlHttp.open("GET","reserve_room.php?name="+final_name+"&room_number="+str,true);
xmlHttp.send(null);
}